<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <!-- 编写函数has(arr , 60) 判断数组中是否存在60这个元素，返回布尔类型

```javascript
var arr = [1, 2, 3, 60]
var arr2 = [1, 2, 3]

function has() {
  // code in here ...
}

console.log(has(arr, 60)) // true
console.log(has(arr2, 60)) // false
``` -->

    <script>
        var arr = [1, 2, 3, 60]
        var arr2 = [1, 2, 3]
            // 编写函数
        function has(arr, n) {
            // 先设置变量值为false
            var j = false
            for (var i = 0; i < arr.length; i++) {
                // 设置条件， 等于n就成立
                if (arr[i] === n) {
                    j = true
                    break
                }

            }
            return j
        }
        console.log(has(arr, 60))
        console.log(has(arr2, 60))
    </script>
</body>

</html>